package Rozetka.test;

import Rozetka.Pages.CheckOutPage;
import Rozetka.Pages.HomePage;
import Rozetka.Pages.SearchPage;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

public class OrderEmptyBasket extends TestCondition {

    @DataProvider(name = "OnlineOrder2")
    public Object[][] provideData1()
    {
        return new Object[][]         {
                { "GoClever Aries 785", "0"  },
        };
    }

    @Test(dataProvider = "OnlineOrder2")
    public void onlineOrderNegativeEmptyRecycleBin(String searchQuery, String amount ) throws InterruptedException {
        HomePage home = new HomePage(driver);
        home.open();
        SearchPage search = home.searchProduct(searchQuery);
        CheckOutPage checkOutPage = search.makeOrder(amount);
        Assert.assertFalse(checkOutPage.negativeOnlineOrderEmptyRecycleBin());
    }

    @AfterMethod
    public void post() {
        HomePage home = new HomePage(driver);
        home.open();
        Assert.assertTrue(home.cleanBasket());
    }
}
